package com.heo.protocol.packet;

import org.apache.log4j.Logger;

import com.heo.util.ByteHelper;

public class EditDevicePasswordResp extends BasePacket
{
  private int BODY_LENGTH = 1;// 包体长1

  private static final String PACKET_NAME = "[修改设备密码应答包]";
  private static Logger log = Logger.getLogger(EditDevicePasswordResp.class);

  private byte result = 0x03;// 默认返回错误

  public EditDevicePasswordResp(short sequenceId) throws Exception
  {
    super(PACKET_NAME);
    super.totalLength = (short) (HEAD_LENGTH + BODY_LENGTH);
    super.commandId = DeviceCommand.EDIT_LOGIN_PASSWORD_RESP;
    super.sequenceId = sequenceId;
  }

  @Override
  public int getTotalLength()
  {
    return super.HEAD_LENGTH + 1;
  }

  @Override
  public byte[] getPacketBody()
  {
    return ByteHelper.margeByte(new byte[] { result }, null, null, null, null, null, null, null, null, null);
  }

  public static void main(String[] args)
  {

  }

  @Override
  public void makeBody()
  {

  }

  public byte getResult()
  {
    return result;
  }

  public void setResult(byte result)
  {
    this.result = result;
  }

}
